Appearance
RSA could be hard, or easy?
Files given:
python
nbit = 64
while True:
p, q = getPrime(nbit), getPrime(nbit)
P = int(str(p) + str(q))
Q = int(str(q) + str(p))
PP = int(str(P) + str(Q))
QQ = int(str(Q) + str(P))
if isPrime(PP) and isPrime(QQ):
breakThis challenge generates our primes with the above method. In order to understand what's going on, we can rewrite in terms of . Let be the number of decimal digits of respectively, then
Looking closely at the expansion, it tells us that by taking the first and last -ish digits of , we get a very good approximation of . Since we know , we expect the length to be , hence we simply brute force a little by hand until yafu factorization finds only two prime factors of
PQ =
9802713296337413422\
272498467780536422550545430268877750619346836296911192794023888752291658602460169966140187114767462486843957741638712\
2924526713690754043
pq =
9802713296337413421\
2924526713690754043Solution at solve.py